package org.lee.basic.algorithm;

/**
 * @author jackielee
 * @version 1.0
 * @description Decompose
 * @date 2021/4/19
 */
public class Decompose {
  public static void main(String[] args) {
    int n = 90;
    // 分解质因数
    decompose(n);
  }

  private static void decompose(int n) {
    System.out.print(n + "=");
    for (int i = 2; i < n + 1; ++i) {
      while (n % i == 0 && n != i) {
        n /= i;
        System.out.print(i + "*");
      }
      if (n == i) {
        System.out.println(i);
        break;
      }
    }
  }
}
